package com.naiterui.ehp.bs.recommend.remote;


import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.naiterui.ehp.bp.bo.b2c.cms.MedicineBO;
import com.naiterui.ehp.bp.bo.b2c.order.OrderBO;
import com.naiterui.ehp.bp.bo.medication.MedicationDefaultUsageBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.recommend.vo.SuperviseSkuVO;

/**
 * @author gaoliangliang
 * @date 2019-06-24 14:57
 * @since 1.0.0
 */
@FeignClient(name = "b2cFeignClient", url = "${ehp.domain.b2c}", configuration = FeignConfiguration.class)
public interface IB2cFeignClient {


    /**
     * 再次求药处方，从购物车清除
     * @param recomId
     * @throws BusinessException
     */
    @PostMapping("inner/carts/remove/require/recom")
    void cleanCart(@RequestParam("recomId") Long recomId) throws BusinessException;

    @PostMapping("inner/supervise/recom/product")
    List<SuperviseSkuVO> recomProduct(@RequestBody List<Long> skuIds);

    /**
     * 获取药品用法用量
     * @param skuIds
     * @return
     */
    @PostMapping("inner/medicine/usage/find")
    Map<Long, MedicationDefaultUsageBO> getMedicationDefaultUsage(@RequestBody Set<Long> skuIds);

    /**
     * 批量获取sku价格
     *
     * @param skuIdSet
     * @return
     */
    @PostMapping("inner/cms/sku/getSkuPrice")
    Map<Long, Integer> getSkuPrice(@RequestBody Set<Long> skuIdSet);

    /**
     * 获取药品的规格和用法用量
     *
     * @param pIdSet
     * @return
     */
    @PostMapping("inner/cms/medicine/getByIds")
    List<MedicineBO> getByIds(@RequestBody Set<Long> pIdSet);

    /**
     * 批量获取订单Id
     *
     * @param recomIds
     * @return
     */
    @PostMapping("inner/cms/orders/getOrderId")
    Map<Long, Long> getOrderId(@RequestBody Set<Long> recomIds);

    @PostMapping("inner/cms/medicine/getByIds")
    List<MedicineBO> medicineList(@RequestBody Set<Long> productIds);

    @PostMapping("inner/supervise/order/list")
    List<OrderBO> orderlist(@RequestBody List<Long> recomIds);
}
